<?php
namespace bee;
define("BEE_JQ_DATE_DMY", 			  "dd.mm.yy");
define("BEE_JQ_DATE_DMYY", 			  "dd.mm.yyyy");
define("BEE_JQ_DATE_YMD", 			  "yy-mm-dd");
define("BEE_JQ_DATE_MDY", 			  "mm/dd/yy");
define("BEE_JQ_DATE_DMYY_HMS", 		"dd.mm.yyyy HH:MM");
define("BEE_JQ_DATE_HR", 			    "hr");
define("BEE_JQ_DATE_DE", 			    "de");
define("BEE_JQ_DATE_EN_GB", 		  "en-gb");
define("BEE_JQ_DATE_FR", 		      "fr");
define("BEE_JQ_DATE_RU", 			    "ru");
define("BEE_JQ_SHOWON_FOCUS", 		"focus");
define("BEE_JQ_SHOWON_BUTTON", 		"button");
define("BEE_JQ_SHOWON_BOTH", 		  "both");
define("BEE_JQ_ANIM_SHOW", 			  "show");
define("BEE_JQ_ANIM_SLIDEDOWN", 	"slideDown");
define("BEE_JQ_ANIM_FADEIN", 		  "fadeIn");
define("BEE_JQ_ANIM_BLIND", 		  "blind");
define("BEE_JQ_ANIM_BOUNCE", 		  "bounce");
define("BEE_JQ_ANIM_CLIP", 			  "clip");
define("BEE_JQ_ANIM_DROP", 			  "drop");
define("BEE_JQ_ANIM_FOLD", 			  "fold");
define("BEE_JQ_ANIM_SLIDE", 		  "slide");

/**
 *
 * @author dzelenika
 *
 */
class text extends widget
{
  /**
   *
   * @var eventDetails
   */
  public $onChangeFn;
  public $onSelectFn;

  //public $helper;
  /**
   *
   * @var datePicker
   */
  public $datePicker;
  /**
   *
   * Enter description here ...
   * @var autoComplete
   */
  public $autoComplete;

  function __construct($name, &$bindValue="")
  {/*
    if(isset($bindValue))
    { $this->bindValue($bindValue);
      //$this->value = $bindValue;
    }
    */
    $this->bindValue($bindValue);
    parent::__construct($name);
    //echo "<br />NEW TXT:/ $this->name / $this->value /";
    $this->widgetType = WIDGET_TEXT;
  }


/**
 *
 * @param array $evt
 */
  public function onDraw($evt)
  { //echo "*+*+*+*";
    $this->fillDSDoc();

  }

  /**
   *
   * @param sting $fillVar
   */
  public function fillDSDoc($fillVar = "")
  {
    $__DSDoc = XMLDataHub::getInstance();
    if($fillVar)
    { $__DSDoc->setVariable($fillVar, $this->value);
    }
    //echo "<br />FILL DSDOC TXT: /$this->name / $this->value /";
    $__DSDoc->setObject("/form/widgets/" . $this->name, $this);

  }
/*
  public function setHelper(textHelper $helper)
  { $this->helper = $helper;
    $this->onBlurFn = new eventDetails(ACTION_TYPE_JAVASCRIPT, "hideHelper('#" . $this->helper->id .  "')" );
  }
  */
}

class datePicker
{  public $dateFormat;
   public $regional;
   public $altField;
   public $altFormat;
   public $showButtonPanel;
   public $changeMonth;
   public $changeYear;
   public $showOtherMonths;
   public $selectOtherMonths;
   public $showWeek;
   public $numberOfMonths;
   public $showOn;
   public $buttonImage;
   public $buttonImageOnly;
   public $showAnim;

   public function __construct()
   { $this->dateFormat = BEE_JQ_DATE_DMYY;
     $this->regional = BEE_JQ_DATE_HR;
     $this->showOn = BEE_JQ_SHOWON_BUTTON;
     $this->buttonImage = "/images/calendar.gif";
     $this->changeYear=true;
     $this->changeMonth = true;
     $this->showOtherMonths = true;
     $this->showWeek=true;
     $this->buttonImageOnly = true;
   }
}

class autoComplete
{ public $source;
  public $minLength;
  public $close;
  public $select;
}